package etf.pia.entity;
// Generated Feb 13, 2014 1:21:45 AM by Hibernate Tools 3.6.0


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Katedra generated by hbm2java
 */
@Entity
@Table(name="katedra"
    ,catalog="pia"
    , uniqueConstraints = @UniqueConstraint(columnNames="opis") 
)
public class Katedra  implements java.io.Serializable {


     private Integer idKatedra;
     private String opis;
     private Set<Projekti> projektis = new HashSet<Projekti>(0);
     private Set<Predmet> predmets = new HashSet<Predmet>(0);

    public Katedra() {
    }

	
    public Katedra(String opis) {
        this.opis = opis;
    }
    public Katedra(String opis, Set<Projekti> projektis, Set<Predmet> predmets) {
       this.opis = opis;
       this.projektis = projektis;
       this.predmets = predmets;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="id_katedra", unique=true, nullable=false)
    public Integer getIdKatedra() {
        return this.idKatedra;
    }
    
    public void setIdKatedra(Integer idKatedra) {
        this.idKatedra = idKatedra;
    }

    
    @Column(name="opis", unique=true, nullable=false, length=45)
    public String getOpis() {
        return this.opis;
    }
    
    public void setOpis(String opis) {
        this.opis = opis;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="katedra")
    public Set<Projekti> getProjektis() {
        return this.projektis;
    }
    
    public void setProjektis(Set<Projekti> projektis) {
        this.projektis = projektis;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="katedra")
    public Set<Predmet> getPredmets() {
        return this.predmets;
    }
    
    public void setPredmets(Set<Predmet> predmets) {
        this.predmets = predmets;
    }




}


